package com.ddyx.rest;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ddyx.common.util.RequestForm;
import com.ddyx.common.util.ResponseForm;
import com.ddyx.service.ITaskGroupService;

/**
 * @author cj
 */
@Controller
@RequestMapping("/taskGroup")
public class TaskGroupController {

	@Resource
	ITaskGroupService iTaskGroupService;
	
	/**
	 * 获取任务组列表接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getTaskGroupInfo", method = RequestMethod.POST)
	public String getTaskGroupInfo(@RequestBody RequestForm requestForm) {
		return iTaskGroupService.getTaskGroupInfoByIdPage(requestForm);
	}
	
	/**
	 * 任务组添加接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/addTaskGroup", method = RequestMethod.POST)
	public ResponseForm addTaskGroup(@RequestBody RequestForm requestForm) {
		return iTaskGroupService.addTaskGroup(requestForm);
	}
	
	/**
	 * 任务组删除接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/deleteTaskGroup", method = RequestMethod.POST)
	public ResponseForm deleteTaskGroup(@RequestBody RequestForm requestForm) {
		return iTaskGroupService.deleteTaskGroup(requestForm);
	}
	
	/**
	 * 任务组修改接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/modifyTaskGroup", method = RequestMethod.POST)
	public ResponseForm modifyTaskGroup(@RequestBody RequestForm requestForm) {
		return iTaskGroupService.modifyTaskGroup(requestForm);
	}
	
	/**
	 * 根据任务组id获取任务列表接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getTaskByGroupId", method = RequestMethod.POST)
	public String getTaskByGroupId(@RequestBody RequestForm requestForm) {
		return iTaskGroupService.getTaskByGroupId(requestForm);
	}
}
